/*
 * GameStartedSubStateController.cpp
 *
 *  Created on: Dec 27, 2011
 *      Author: rudi
 */
#include <wx/socket.h>
#include "GameStartedSubStateController.h"
#include "SmartPointer.h"
#include "App.h"

GameStartedSubStateController::GameStartedSubStateController(): mGameStartedController(NULL)
{
	// Nothing to do
}

/*virtual*/
GameStartedSubStateController::~GameStartedSubStateController()
{
	// Nothing to do
}

/**
 * Protected methods
 */

void GameStartedSubStateController::sendDataToRemoteSide(NetworkEventData::DataType dataType, const wxPoint& position)
{
	SmartPointer<NetworkEventData> data =  NULL;
	wxSocketBase* socket = wxGetApp().getClientSocket();

	if(NULL == socket)
		return;
	data = new NetworkEventData();
	data->setDataType(dataType);
	data->setX(position.x);
	data->setY(position.y);
	data->write(socket);
}
